<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<?php 
	$ci = &get_instance();
	$USER = getAccountUserObject();
	$ESCORT = $ci->escort_entity->init('user_id',$USER->getId());
	$LOCKED = $ci->locked_escort_entity->init('escort_id', $ESCORT->getId());
?>

<form action="<?php echo site_url('escorts/submit_data/submit_appareance');?>" name="submit_appareance" id="submit_appareance" method="post" enctype="multipart/form-data" >
	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span><?php echo language_translate('appareance_hair');?></span>
			<div class="help-text" title="<?php echo language_translate('appareance_hair_hint');?>"></div>	
		</div>
		<div class="dashboard-info-right">
			<div class="select-box">
				<?php echo form_dropdown('appareance_hair_color_id', getHairColorOptionData_ioc(), array($ESCORT->getHairColorId()) , 'id="appareance_hair_color_id" class="custom"' );?>
			</div>
			<div class="select-box">
				<?php echo form_dropdown('appareance_hair_long_id', getHairLongOptionData_ioc(), array($ESCORT->getHairSizeId()) , 'id="appareance_hair_long_id" class="custom"' );?>
			</div>
			<div class="select-box">
				<?php echo form_dropdown('appareance_hair_style_id', getHairStyleOptionData_ioc(), array($ESCORT->getHairStyleId()) , 'id="appareance_hair_style_id" class="custom"' );?>
			</div>
			<div class="input-box" style="margin-right:0px;">
				<input type="checkbox" onoff="1" value="1" name="appareance_public_hair" class="custom" 
					<?php echo $ESCORT->getPublicHair() == 1 ? "checked='checked'":''; ?> />
			</div>
			<?php if($LOCKED->getLockedHair() == 1):?>
				<div class="locked"></div>
			<?php endif;?>	
			
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span><?php echo language_translate('appareance_eye');?></span>
			<div class="help-text" title="<?php echo language_translate('appareance_eye_hint');?>"></div>	
		</div>
		<div class="dashboard-info-right">
			<div class="select-box">
				<?php echo form_dropdown('appareance_eye_id', getEyeOptionData_ioc(), array($ESCORT->getEyeId()) , 'id="appareance_eye_id" class="custom"' );?>
			</div>
			<div class="input-box">
				<input type="checkbox" onoff="1" value="1" name="appareance_public_eye" class="custom" 
				<?php echo $ESCORT->getPublicEye() == 1 ? "checked='checked'":''; ?> />
			</div>
			
			<?php if($LOCKED->getLockedEye() == 1):?>
				<div class="locked"></div>
			<?php endif;?>	
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span><?php echo language_translate('appareance_height');?></span>
			<div class="help-text" title="<?php echo language_translate('appareance_height_hint');?>"></div>	
		</div>
		<div class="dashboard-info-right">
			<div class="select-box">
				<?php echo form_dropdown('appareance_height_id', getHeightOptionData_ioc(), array($ESCORT->getHeight()), 'id="appareance_height_id" class="custom"');?>
			</div>
			<div class="input-box">
				<input type="checkbox" onoff="1" value="1" name="appareance_public_height" class="custom" 
				<?php echo $ESCORT->getPublicHeight() == 1 ? "checked='checked'":''; ?> />
			</div>
			
			<?php if($LOCKED->getLockedHeight() == 1):?>
				<div class="locked"></div>
			<?php endif;?>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span><?php echo language_translate('appareance_weight');?></span>
			<div class="help-text" title="<?php echo language_translate('appareance_weight_hint');?>"></div>	
		</div>
		<div class="dashboard-info-right">
			<div class="select-box">
				<?php echo form_dropdown('appareance_weight_id', getWeightOptionData_ioc(), array($ESCORT->getWeight()), 'id="appareance_weight_id" class="custom"');?>
			</div>
			<div class="input-box">
				<input type="checkbox" onoff="1" value="1" name="appareance_public_weight" class="custom" 
				<?php echo $ESCORT->getPublicWeight() == 1 ? "checked='checked'":''; ?> />
			</div>
			
			<?php if($LOCKED->getLockedWeight() == 1):?>
				<div class="locked"></div>
			<?php endif;?>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left">
			<span><?php echo language_translate('appareance_measure');?></span>
			<div class="help-text" title="<?php echo language_translate('appareance_measure_hint');?>"></div>	
		</div>
		<div class="dashboard-info-right">
			<div class="select-box">
				<?php echo form_dropdown('appareance_measure1_id', getMeasureOptionData_ioc(), array($ESCORT->getMeasure1()), 'id="appareance_measure1_id" class="custom"');?>
			</div>
			<div class="select-box">
				<?php echo form_dropdown('appareance_measure2_id', getMeasureOptionData_ioc(), array($ESCORT->getMeasure2()), 'id="appareance_measure2_id" class="custom"');?>
			</div>
			<div class="select-box">
				<?php echo form_dropdown('appareance_measure3_id', getMeasureOptionData_ioc(), array($ESCORT->getMeasure3()), 'id="appareance_measure3_id" class="custom"');?>
			</div>
			<div class="input-box" style="margin-right:0px;">
				<input type="checkbox" onoff="1" value="1" name="appareance_public_measures" class="custom" 
				<?php echo $ESCORT->getPublicMeasures() == 1 ? "checked='checked'":''; ?> />
			</div>
			
			<?php if($LOCKED->getLockedMeasures() == 1):?>
				<div class="locked"></div>
			<?php endif;?>
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>

	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left"> 
			<div class="select-box">
				<input type="submit" class="save-button" value="<?php echo language_translate('appareance_save');?>" /> 
			</div>
		 </div>
		 <div class="dashboard-info-right">
			<?php echo loader_image("id='appareance_loader_image' class='hidden'");?>
		</div>
		<div class="clear"></div>
	</div>	 
	
	<div class="dashboard-info-wrapper">
		<div id="update-message"><?php echo language_translate('update_successfully_message');?></div>
		<div class="clear"></div>
	</div>
	
</form>

<script type="text/javascript">
$(document).ready(function() { 
	var options = { 
		beforeSubmit:  validateB4SubmitAppareance,  
		success:       processAfterRespondingAppareance   
	};	
	$('#submit_appareance').ajaxForm(options); 
	$('.help-text[title]').qtip({ style: { name: 'dark', tip: true } });
});	
function validateB4SubmitAppareance(formData, jqForm, options){
	$('#appareance_loader_image').show();
	return true;
}

function processAfterRespondingAppareance(responseText, statusText, xhr, $form) {
	$('#appareance_loader_image').hide();	
	if(responseText == 'ok'){
		updatedShow();
	}else{
		debug(responseText);
	}
}
</script>